home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…rary 5 (Internal Edition) / Apple R&P Lib Internal v5.0.iso / 6-Developer Demos / Developer Demos-Ed. / Math CAD Demo / Sample Files / Anharmonic next >
Text File  |  1989-05-23  |  820b  |  36 lines

  1. .MCD 30002 0
  2. .CMD PLOTFORMAT logs=0,0 subdivs=1,1 size=5,15 type=l
  3. .CMD FORMAT  rd=d ct=10 im=i et=3 zt=15 pr=3 mass length time charge
  4. .CMD SET ORIGIN 0
  5. .CMD SET TOL 0.001000
  6. .CMD MARGIN 0
  7. .CMD LINELENGTH 68
  8. .CMD SET PRNCOLWIDTH 8
  9. .CMD SET PRNPRECISION 4
  10. .TXT 0 0 1 24 
  11. a1,24,24,24
  12. ANHARMONIC OSCILLATIONS
  13. .TXT 0 35 1 32 
  14. a1,32,32,37
  15. Over a mesh of N points from a to -a
  16. .EQN 1 -35 1 10 
  17. N:100
  18. .EQN 0 14 1 12 
  19. i:1;N
  20. .EQN 0 14 1 10 
  21. a:3.1
  22. .EQN 1 4 3 23 
  23. x[i:a*(2*i/(N+1)-1)
  24. .EQN 1 -32 2 9 
  25. t[0:0
  26. .EQN 0 16 2 9 
  27. x[0:a
  28. .TXT 3 -16 2 60 
  29. a2,60,60,134
  30. We compute the times at which these points are reached by an 
  31. oscillator having a cosine potential energy, and plot their trajectory.
  32. .EQN 3 0 5 34 
  33. t[i:t[(i-1)+a/\|(cos(x[i)-cos(a))
  34. .EQN 0 36 8 30 
  35. a&-a&x[i{1,1,6,25,d}@t[N&0&t[i
  36.